/*
 * CRTP_ARP_table.h
 *
 *  Created on: May 18, 2013
 *      Author: ILYA
 */

#ifndef CRTP_ARP_TABLE_H_
#define CRTP_ARP_TABLE_H_

#include "General_definitions.h"
#include "llc.h"
#include "tree_as_list.h"
#include "printf-stdarg.h"
#include "string.h"
#define FLASH_ADDRESS 0

/*CRTP start*/
enum CRTP_STATE {SUCCESS = 0, BUSY = 4};
/*this function called when a packet has been received and send data to application layer*/
enum CRTP_STATE crtp_input(data_type *data, int poll_final_bit, int port);
/*this function is calling by application layer, when it need to send data*/
enum CRTP_STATE crtp_output(unsigned char *data, int data_size, int poll_final_bit, int port);
/*CRTP end*/

/*ARP start*/
extern unsigned char *is_arp_i_not_null;
extern unsigned char queueing_row;
extern TreeNode *rootOfTree;

void init_arp_table(void);
/*this function must write some fields of list_rim_frame into ARP table*/
void write_in_arp(struct ListRIMFrames list_rim_frame);
/*this function must return list_rim_frame from "Link_ID" row of ARP table*/
void read_from_arp(struct ListRIMFrames *list_rim_frame, char Link_ID);
/*this function must delete "Link_ID" row of ARP table*/
void delete_from_arp(char Link_ID);
/*ARP end*/

#endif /* CRTP_ARP_TABLE_H_ */
